/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2022-10-30
 * Time: 15:04
 */
//需要导入util包，类似头文件
//输入
import java.util.Scanner;
//随机数
import java.util.Random;
public class Test {
    public static void main(String[] args) {
        //new对象
        Random random = new Random();
        Scanner scan = new Scanner(System.in);
        //随机数，[0,100)
        int guess = random.nextInt(100);
        while (true){
            System.out.println("请输入猜的数字：（1-100）");
            int num = scan.nextInt();
            if (guess == num){
                System.out.println("true!");
                break;
            }else if (num < guess){
                System.out.println("small");
            }else {
                System.out.println("big");
            }
        }
        scan.close();

    }




    public static void main1(String[] args) {
        //java键盘读取的方法
//        Scanner scan = new Scanner(System.in);
//        System.out.println("输入名字:");
//        String name = scan.nextLine();
//        System.out.println("请输入年龄：");
//        int year = scan.nextInt();
//        System.out.println("名字是："+ name + "\n年龄是：" + year);
//        scan.close();
//      循环输入的方法
        Scanner scan = new Scanner(System.in);
        int num = 0;
        //判断输入的是否是int，如不是则跳出循环
        while (scan.hasNextInt()){
            num = scan.nextInt();
            System.out.println(num);
        }
        scan.close();


    }
}
